package com.dongdongshop.controller;

import com.dongdongshop.data.Result;
import com.dongdongshop.service.ItemService;
import com.dongdongshop.vo.ItemVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("item")
public class ItemController {
    @Autowired
    private ItemService itemService;

    @PostMapping("subStockCount")
    public Result subStockCount(@RequestBody List<ItemVO> itemVOList){
        itemService.subStockCount(itemVOList);
        return Result.OK();
    }
}
